#ifndef __TERRAIN_H__
#define __TERRAIN_H__

#include <iostream>
#include <windows.h>
#include <gl/glut.h>

class Terrain
{
private:
	//x, y, z three dimension min max
	float vertex_min[3];
	float vertex_max[3];
public:
	Terrain()
	{
		vertex_min[0] = -10000;
		vertex_max[0] = 10000;
		vertex_min[1] = -2000;
		vertex_max[1] = 100;
		vertex_min[2] = -10000;
		vertex_max[2] = 10000;
	}
	void Draw()
	{
		glPolygonMode(GL_FRONT, GL_FILL);
		glPolygonMode(GL_BACK, GL_FILL);
		glBegin(GL_QUADS);
		
		glColor3f(1.0, 0, 0);
			glVertex3f(vertex_min[0], vertex_max[1], vertex_min[2]);
			glVertex3f(vertex_max[0], vertex_max[1], vertex_min[2]);
			glVertex3f(vertex_max[0], vertex_max[1], vertex_max[2]);
			glVertex3f(vertex_min[0], vertex_max[1], vertex_max[2]);

			glEnd();
			glBegin(GL_QUADS);

			glColor3f(1.0, 0, 0);
			glVertex3f(vertex_min[0], vertex_min[1], vertex_min[2]);
			glVertex3f(vertex_max[0], vertex_min[1], vertex_min[2]);
			glVertex3f(vertex_max[0], vertex_min[1], vertex_max[2]);
			glVertex3f(vertex_min[0], vertex_min[1], vertex_max[2]);
			glEnd();
			glBegin(GL_QUADS);
			glColor3f(0, 0, 1.0);
			glVertex3f(vertex_min[0], vertex_min[1], vertex_min[2]);
			glVertex3f(vertex_min[0], vertex_max[1], vertex_min[2]);
			glVertex3f(vertex_min[0], vertex_max[1], vertex_max[2]);
			glVertex3f(vertex_min[0], vertex_min[1], vertex_max[2]);
			glEnd();

			glBegin(GL_QUADS);
			glColor3f(0, 0, 1.0);
			glVertex3f(vertex_max[0], vertex_min[1], vertex_min[2]);
			glVertex3f(vertex_max[0], vertex_max[1], vertex_min[2]);
			glVertex3f(vertex_max[0], vertex_max[1], vertex_max[2]);
			glVertex3f(vertex_max[0], vertex_min[1], vertex_max[2]);
			glEnd();
			glBegin(GL_QUADS);
			glColor3f(0, 1.0, 0);
			glVertex3f(vertex_min[0], vertex_min[1], vertex_min[2]);
			glVertex3f(vertex_max[0], vertex_min[1], vertex_min[2]);
			glVertex3f(vertex_max[0], vertex_max[1], vertex_min[2]);
			glVertex3f(vertex_min[0], vertex_max[1], vertex_min[2]);
			glEnd();

				glBegin(GL_QUADS);
			glColor3f(0, 1.0, 0);
			glVertex3f(vertex_min[0], vertex_min[1], vertex_max[2]);
			glVertex3f(vertex_max[0], vertex_min[1], vertex_max[2]);
			glVertex3f(vertex_max[0], vertex_max[1], vertex_max[2]);
			glVertex3f(vertex_min[0], vertex_max[1], vertex_max[2]);


		glEnd();
	}
};

#endif